<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>

        var num1 = 100.01
        var num2 = '100.01abc'
        var num3 = 'abc100.01'
        console.log(parseFloat(num1))
        console.log(parseInt(num1))
        console.log(parseFloat(num2))
        console.log(parseInt(num2))
        console.log(parseFloat(num3))
        console.log(parseInt(num3))

        var num4 = 100.01
        console.log(typeof num4.toString())

        var str1 = 'abcdefg'
        console.log(str1.length)

        var str2 = '99999asjdajsdka'
        console.log(str1.concat(str2))
        console.log(str1 + str2)

        var str3 = 'auowhanodhfafuawdhfaidhwabxcabe'
        console.log(str3.indexOf('w'))
        console.log(str3.lastIndexOf('w'))

        var str4 = 'asdhjashdjkahciuabsciu'
        str4 = str4.replace('jas', '6')
        console.log(str4)

        var str5 = 'ASDchashdjSdahJSDasd'
        console.log(str5.toUpperCase())
        console.log(str5.toLowerCase())

        var str6 = 'q w e r t y u i o'
        var str7 = 'wd=abc&kkk=456&qqq=789'
        console.log(str6.split(' '))
        console.log(str7.split('&'))


        var str8 = 'asdhjashdjkashdkjahsdiuas'
        console.log(str8.slice(4, 8))

        var num5 = 100
        console.log(Math)
        console.log(Math.abs(-100))
        console.log(Math.ceil(9.0000001))  //
        console.log(Math.floor(9.9999999999999))

        console.log(Math.max(100, 200, 300, 400, 500))
        console.log(Math.min(1, 2, 3, 4, 5, 0))

        console.log(Math.pow(2, 4))
        console.log(Math.pow(10, 3))
        console.log(Math.sqrt(4, 2))
        console.log(Math.random())

        console.log(Math.random() * 20)

        console.log(Math.random() * 20 + 5)

        console.log(Array.isArray('abc'))
        console.log(Array.isArray([1, 2, 3, 4]))

        console.log(Array.of(1, 2, 3, 4, 5, 6, 7, 8, 8))

        console.log(Array.from('abc'))


        var arr1 = [1, 2, 3, 4, 5]
        console.log(arr1.pop())
        console.log(arr1)
        console.log(arr1.push(100))
        console.log(arr1)
        console.log(arr1.shift())
        console.log(arr1) 
        console.log(arr1.unshift(400))
        console.log(arr1)

        console.log(arr1.length) // 5

        var arr2 = [1, 2, 3, 4, 5, 6, 7]
        console.log(arr2.splice(2, 3, 100, 200, 300, 400, 500, 600))
        console.log(arr2)

        var arr3 = [1, 2, 3, 4, 5, 6, 7]
        arr3.splice(3, 0, 100)
        console.log(arr3)

        arr3.splice(5, 1)
        console.log(arr3)


        var arr4 = [1, 2, 3, 4, 5]
        console.log(arr4.reverse())
        console.log(arr4)


        var arr5 = [4, 3, 2, 20, 5, 7, 14, 3, 4, 21, 2, 5, 3]
        arr5.sort(function (a, b) {
            return b - a
        })
        console.log(arr5)


        var arr6 = [1, 2, 3, 4, 5]
        arr6.fill(100, 2, 4)
        console.log(arr6)


        var arr7 = [1, 2, 3, 4, 5, 6, 7]
        console.log(arr7.slice(3, 5))
        console.log(arr7)


        var str10 = 'a b c d e f g'
        var arr10 = str10.split(' ')

        console.log(arr10.join('-'))

        function demo(a, b, c, d) { 
            console.log(a, b, c, d)
        }
        demo(100, 200, 300, 400) 

    </script>
</body>
</html>